package com.ssy.lingxi.settle.accounts.repository;

import com.ssy.lingxi.settle.accounts.entity.MemberSettlementStrategyDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 会员结算策略
 * @author 伍将
 * @date 2020/10/21
 * @version 2.0.0
 */
public interface MemberSettlementStrategyRepository extends JpaRepository<MemberSettlementStrategyDO, Long>, JpaSpecificationExecutor<MemberSettlementStrategyDO> {

    /**
     * 根据状态以及单据类型查询结算策略
     * @author 伍将
     * @date 2020/12/24
     * @param memberId 会员id
     * @param roleId 角色id
     * @param status 状态
     * @param settlementOrderType 单据类型
     * @return 结算策略
     **/
    List<MemberSettlementStrategyDO> findAllByMemberIdAndRoleIdAndStatusAndSettlementOrderType(Long memberId, Long roleId, Integer status, Integer settlementOrderType);
}
